Integrand size = 21, antiderivative size = 127 \[ \int \frac {\cos ^4(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {a \left (2 a^2-3 b^2\right ) x}{2 b^4}+\frac {2 \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{b^4 d}+\frac {\cos ^3(c+d x)}{3 b d}-\frac {\cos (c+d x) \left (2 \left (a^2-b^2\right )-a b \sin (c+d x)\right )}{2 b^3 d} \]
[Out]
Time = 0.17 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2774, 2944, 2814, 2739, 632, 210} \[ \int \frac {\cos ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {2 \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{b^4 d}-\frac {a x \left (2 a^2-3 b^2\right )}{2 b^4}-\frac {\cos (c+d x) \left (2 \left (a^2-b^2\right )-a b \sin (c+d x)\right )}{2 b^3 d}+\frac {\cos ^3(c+d x)}{3 b d} \]
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2774
Rule 2814
Rule 2944
Rubi steps \begin{align*} \text {integral}& = \frac {\cos ^3(c+d x)}{3 b d}+\frac {\int \frac {\cos ^2(c+d x) (b+a \sin (c+d x))}{a+b \sin (c+d x)} \, dx}{b} \\ & = \frac {\cos ^3(c+d x)}{3 b d}-\frac {\cos (c+d x) \left (2 \left (a^2-b^2\right )-a b \sin (c+d x)\right )}{2 b^3 d}+\frac {\int \frac {-b \left (a^2-2 b^2\right )-a \left (2 a^2-3 b^2\right ) \sin (c+d x)}{a+b \sin (c+d x)} \, dx}{2 b^3} \\ & = -\frac {a \left (2 a^2-3 b^2\right ) x}{2 b^4}+\frac {\cos ^3(c+d x)}{3 b d}-\frac {\cos (c+d x) \left (2 \left (a^2-b^2\right )-a b \sin (c+d x)\right )}{2 b^3 d}+\frac {\left (a^2-b^2\right )^2 \int \frac {1}{a+b \sin (c+d x)} \, dx}{b^4} \\ & = -\frac {a \left (2 a^2-3 b^2\right ) x}{2 b^4}+\frac {\cos ^3(c+d x)}{3 b d}-\frac {\cos (c+d x) \left (2 \left (a^2-b^2\right )-a b \sin (c+d x)\right )}{2 b^3 d}+\frac {\left (2 \left (a^2-b^2\right )^2\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^4 d} \\ & = -\frac {a \left (2 a^2-3 b^2\right ) x}{2 b^4}+\frac {\cos ^3(c+d x)}{3 b d}-\frac {\cos (c+d x) \left (2 \left (a^2-b^2\right )-a b \sin (c+d x)\right )}{2 b^3 d}-\frac {\left (4 \left (a^2-b^2\right )^2\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^4 d} \\ & = -\frac {a \left (2 a^2-3 b^2\right ) x}{2 b^4}+\frac {2 \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{b^4 d}+\frac {\cos ^3(c+d x)}{3 b d}-\frac {\cos (c+d x) \left (2 \left (a^2-b^2\right )-a b \sin (c+d x)\right )}{2 b^3 d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(428\) vs. \(2(127)=254\).
Time = 3.17 (sec) , antiderivative size = 428, normalized size of antiderivative = 3.37 \[ \int \frac {\cos ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\cos ^3(c+d x) \left (12 (a-b)^2 (a+b) \text {arctanh}\left (\frac {\sqrt {a-b} \sqrt {-\frac {b (1+\sin (c+d x))}{a-b}}}{\sqrt {a+b} \sqrt {-\frac {b (-1+\sin (c+d x))}{a+b}}}\right ) \sqrt {1-\sin (c+d x)}+\sqrt {a+b} \left (-12 \sqrt {a-b} \left (a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {\frac {b (1+\sin (c+d x))}{-a+b}}}{\sqrt {-\frac {b (-1+\sin (c+d x))}{a+b}}}\right ) \sqrt {1-\sin (c+d x)}+\sqrt {-\frac {b (-1+\sin (c+d x))}{a+b}} \left (-6 \sqrt {b} \left (-2 a^2+a b+2 b^2\right ) \text {arcsinh}\left (\frac {\sqrt {a-b} \sqrt {-\frac {b (1+\sin (c+d x))}{a-b}}}{\sqrt {2} \sqrt {b}}\right )+\sqrt {a-b} \sqrt {1-\sin (c+d x)} \sqrt {\frac {b (1+\sin (c+d x))}{-a+b}} \left (6 a^2-8 b^2-3 a b \sin (c+d x)+2 b^2 \sin ^2(c+d x)\right )\right )\right )\right )}{6 (a-b)^{3/2} b^2 \sqrt {a+b} d (1-\sin (c+d x))^{3/2} \sqrt {-\frac {b (-1+\sin (c+d x))}{a+b}} \left (-\frac {b (1+\sin (c+d x))}{a-b}\right )^{3/2}} \]
[In]
[Out]
Time = 0.90 (sec) , antiderivative size = 203, normalized size of antiderivative = 1.60
method | result | size |
derivativedivides | \(\frac {\frac {2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{b^{4} \sqrt {a^{2}-b^{2}}}-\frac {2 \left (\frac {\frac {\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a \,b^{2}}{2}+\left (a^{2} b -2 b^{3}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 a^{2} b -2 b^{3}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a \,b^{2}}{2}+a^{2} b -\frac {4 b^{3}}{3}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {a \left (2 a^{2}-3 b^{2}\right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}\right )}{b^{4}}}{d}\) | \(203\) |
default | \(\frac {\frac {2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{b^{4} \sqrt {a^{2}-b^{2}}}-\frac {2 \left (\frac {\frac {\left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a \,b^{2}}{2}+\left (a^{2} b -2 b^{3}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 a^{2} b -2 b^{3}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a \,b^{2}}{2}+a^{2} b -\frac {4 b^{3}}{3}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {a \left (2 a^{2}-3 b^{2}\right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}\right )}{b^{4}}}{d}\) | \(203\) |
risch | \(-\frac {a^{3} x}{b^{4}}+\frac {3 a x}{2 b^{2}}-\frac {{\mathrm e}^{i \left (d x +c \right )} a^{2}}{2 b^{3} d}+\frac {5 \,{\mathrm e}^{i \left (d x +c \right )}}{8 b d}-\frac {{\mathrm e}^{-i \left (d x +c \right )} a^{2}}{2 b^{3} d}+\frac {5 \,{\mathrm e}^{-i \left (d x +c \right )}}{8 b d}+\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a +\sqrt {-a^{2}+b^{2}}}{b}\right ) a^{2}}{d \,b^{4}}-\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a +\sqrt {-a^{2}+b^{2}}}{b}\right )}{d \,b^{2}}-\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {-i a +\sqrt {-a^{2}+b^{2}}}{b}\right ) a^{2}}{d \,b^{4}}+\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {-i a +\sqrt {-a^{2}+b^{2}}}{b}\right )}{d \,b^{2}}+\frac {\cos \left (3 d x +3 c \right )}{12 b d}+\frac {a \sin \left (2 d x +2 c \right )}{4 b^{2} d}\) | \(333\) |
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 332, normalized size of antiderivative = 2.61 \[ \int \frac {\cos ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\left [\frac {2 \, b^{3} \cos \left (d x + c\right )^{3} + 3 \, a b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} d x - 3 \, {\left (a^{2} - b^{2}\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} + 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right ) - 6 \, {\left (a^{2} b - b^{3}\right )} \cos \left (d x + c\right )}{6 \, b^{4} d}, \frac {2 \, b^{3} \cos \left (d x + c\right )^{3} + 3 \, a b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} d x - 6 \, {\left (a^{2} - b^{2}\right )}^{\frac {3}{2}} \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right ) - 6 \, {\left (a^{2} b - b^{3}\right )} \cos \left (d x + c\right )}{6 \, b^{4} d}\right ] \]
[In]
[Out]
Timed out. \[ \int \frac {\cos ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {\cos ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.51 (sec) , antiderivative size = 226, normalized size of antiderivative = 1.78 \[ \int \frac {\cos ^4(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {\frac {3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} {\left (d x + c\right )}}{b^{4}} - \frac {12 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} b^{4}} + \frac {2 \, {\left (3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 12 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, a^{2} - 8 \, b^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3} b^{3}}}{6 \, d} \]
[In]
[Out]
Time = 5.70 (sec) , antiderivative size = 364, normalized size of antiderivative = 2.87 \[ \int \frac {\cos ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\frac {5\,\cos \left (c+d\,x\right )}{4}+\frac {\cos \left (3\,c+3\,d\,x\right )}{12}}{b\,d}+\frac {3\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {a\,\sin \left (2\,c+2\,d\,x\right )}{4}}{b^2\,d}-\frac {a^2\,\cos \left (c+d\,x\right )}{b^3\,d}-\frac {2\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b^4\,d}+\frac {2\,\mathrm {atanh}\left (\frac {2\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}-a^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}+a\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^5+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b-2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3\,b^2-4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^3+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^4+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^5}\right )\,\sqrt {-{\left (a+b\right )}^3\,{\left (a-b\right )}^3}}{b^4\,d} \]
[In]
[Out]